//对外暴露配置路由(常量路由):全部用户都可以访问到的路由
export const constantRoute = [
    {
        //登录页面
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login',
        meta: {
            title: '登录', //菜单标题
            hidden: true, //代表路由标题在菜单中是否隐藏  true:隐藏 false:不隐藏
            icon: 'Promotion', //菜单文字左侧的图标,支持element-plus全部图标
        },
    },
    {
        //注册页面
        path: '/register',
        component: () => import('@/views/register/index.vue'),
        name: 'register',
        meta: {
            title: '注册',
            hidden: true,
            icon: 'Promotion',
        },
    },
    {
        //登录成功以后展示数据的路由
        path: '/',
        component: () => import('@/layout/index.vue'),
        name: 'Layout',
        meta: {
            title: import.meta.env.VITE_APP_TITLE,
            icon: 'HomeFilled',
            hidden: false,
        },
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: () => import('@/views/home/index.vue'),
                name: 'home',
                meta: {
                    title: '首页',
                    hidden: false,
                    icon: 'HomeFilled',
                },
            },
        ],
    },
    {
        //404
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true,
            icon: 'DocumentDelete',
        },
    },
    {
        //任意路由
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        name: 'Any',
        meta: {
            title: '任意路由',
            hidden: true,
            icon: 'DataLine',
        },
    }
]

//admin路由
export const asyncRouteAdmin = [
    {
        path: '/system',
        component: () => import('@/layout/index.vue'),
        name: 'System',
        meta: {
            title: '系统管理',
            icon: 'Setting',
            hidden: false,
        },
        redirect: '/system/banner',
        children: [
            {
                path: '/system/banner',
                component: () => import('@/views/system/banner.vue'),
                name: 'Banner',
                meta: {
                    title: '轮播图管理',
                    icon: 'Grid',
                    hidden: false,
                },
            },
            {
                path: '/system/fitnesscenter',
                component: () => import('@/views/system/fitnesscenter.vue'),
                name: 'Fitnesscenter',
                meta: {
                    title: '健身房管理',
                    icon: 'Film',
                    hidden: false,
                },
            },
            {
                path: '/system/sportsnews',
                component: () => import('@/views/system/sportsnews.vue'),
                name: 'Sportsnews',
                meta: {
                    title: '新闻管理',
                    icon: 'GoldMedal',
                    hidden: false,
                },
            },
        ]
    }, {
        path: '/user',
        component: () => import('@/layout/index.vue'),
        name: 'User',
        meta: {
            title: '用户管理',
            icon: 'User',
            hidden: false,
        },
        redirect: '/user/person',
        children: [
            {
                path: '/user/person',
                component: () => import('@/views/user/person.vue'),
                name: 'Person',
                meta: {
                    title: '个人信息',
                    icon: 'User',
                    hidden: false,
                },
            },
            {
                path: '/user/trainers',
                component: () => import('@/views/user/trainers.vue'),
                name: 'Trainers',
                meta: {
                    title: '教练管理',
                    icon: 'User',
                    hidden: false,
                },
            },
            {
                path: '/user/users',
                component: () => import('@/views/user/users.vue'),
                name: 'Users',
                meta: {
                    title: '用户管理',
                    icon: 'User',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/course',
        component: () => import('@/layout/index.vue'),
        name: 'Course',
        meta: {
            title: '课程管理',
            icon: 'Operation',
            hidden: false,
        },
        redirect: '/course/courses',
        children: [
            {
                path: '/course/courses',
                component: () => import('@/views/course/courses.vue'),
                name: 'Courses',
                meta: {
                    title: '课程管理',
                    icon: 'Operation',
                    hidden: false,
                },
            },
            {
                path: '/course/bookings',
                component: () => import('@/views/course/bookings.vue'),
                name: 'Bookings',
                meta: {
                    title: '预约管理',
                    icon: 'Clock',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/coursetype',
        component: () => import('@/layout/index.vue'),
        name: 'Coursetype',
        meta: {
            title: '项目分类',
            icon: 'User',
            hidden: false,
        },
        redirect: '/coursetype/type',
        children: [
            {
                path: '/coursetype/type',
                component: () => import('@/views/course/type.vue'),
                name: 'Type',
                meta: {
                    title: '项目分类',
                    icon: 'Files',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/forum',
        component: () => import('@/layout/index.vue'),
        name: 'Forum',
        meta: {
            title: '论坛管理',
            icon: 'ChatDotSquare',
            hidden: false,
        },
        redirect: '/forum/forums',
        children: [
            {
                path: '/forum/forums',
                component: () => import('@/views/forum/forums.vue'),
                name: 'Forums',
                meta: {
                    title: '论坛管理',
                    icon: 'ChatDotSquare',
                    hidden: false,
                },
            },
        ]
    },
]
//游客路由
export const asyncRouteVisitor = [
    {
        path: '/user',
        component: () => import('@/layout/index.vue'),
        name: 'User',
        meta: {
            title: '个人信息',
            icon: 'User',
            hidden: false,
        },
        redirect: '/user/person',
        children: [
            {
                path: '/user/person',
                component: () => import('@/views/user/person.vue'),
                name: 'Person',
                meta: {
                    title: '个人信息',
                    icon: 'User',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/course',
        component: () => import('@/layout/index.vue'),
        name: 'Course',
        meta: {
            title: '课程管理',
            icon: 'Operation',
            hidden: false,
        },
        redirect: '/course/courses',
        children: [
            {
                path: '/course/courses',
                component: () => import('@/views/course/courses.vue'),
                name: 'Courses',
                meta: {
                    title: '课程管理',
                    icon: 'Operation',
                    hidden: false,
                },
            },
            {
                path: '/course/bookings',
                component: () => import('@/views/course/bookings.vue'),
                name: 'Bookings',
                meta: {
                    title: '预约管理',
                    icon: 'Clock',
                    hidden: false,
                },
            },
        ]
    },
]
